<%--
  Created by IntelliJ IDEA.
  User: ch-hui
  Date: 15/12/20
  Time: 下午6:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/common/taglibs.jsp" %>
<html>
<head>
    <title>饲料原料列表</title>
</head>
<body>

<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>饲料原料 <small>清单</small></h5>
        <div class="ibox-tools">
          <a class="collapse-link">
            <i class="fa fa-chevron-up"></i>
          </a>
          <a class="close-link">
            <i class="fa fa-times"></i>
          </a>
        </div>
      </div>

      <div class="ibox-content">

        <div class="ibox-tools">
          <button class="btn btn-primary" type="button" name="add"><i class="fa fa-plus"></i>&nbsp;新增原料</button>
        </div>

        <%--<div class="ibox-tools">--%>
          <%--<button class="btn btn-primary" type="button"><i class="fa fa-plus"></i>&nbsp;新增供应商</button>--%>
        <%--</div>--%>

        <table class="table table-striped table-bordered table-hover dataTables-example">
          <thead>
          <tr>
            <th>饲料号</th>
            <th>原料名称</th>
            <th>库存量（kg）</th>
            <th>采购价（元 / kg）</th>
            <th>出库价（元 / kg）</th>
            <th>操作</th>
          </tr>
          </thead>

          <tbody>
          <c:forEach items="${materials}" var="material">
            <tr>
              <td><a href="${BASE}/material/edit/${material.id}">${material.cfn}</a></td>
              <td>${material.name}</td>
              <td class="text-warning">${material.stockQuantity}</td>
              <td><fmt:formatNumber type="currency" var="money1">${material.enterPrice}</fmt:formatNumber><c:out value="${money1}"></c:out></td>
              <td><fmt:formatNumber type="currency" var="money2">${material.markPrice}</fmt:formatNumber><c:out value="${money2}"></c:out></td>
              <td><a data-toggle="modal" data-target="#myModal6" onclick="javascript:add('${material.name}','${material.stockQuantity}')"><i class="fa fa-plus-circle text-navy"></i>&nbsp;入库</a></td>
            </tr>
          </c:forEach>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>

<div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title"></h4>
      </div>
      <div class="modal-body">
        <input type="text" class="form-control" name="stockQuantity" value=""/>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary">保存</button>
      </div>
    </div>
  </div>
</div>


<script type="text/javascript" src="${BASE}/www/script/material/material.js"></script>
</body>
</html>
